<div ng-controller="CookListCtrl as cc" class="cry">
	<div class="cry_title">
        <h3 class="mainTitle">
            <i class="iconfont icon-liebiao"></i>
            厨师列表
        </h3>
        <div class="tools">
            <ul>
                <!-- <li class="select_box" ng-if="cc.role=='ASSOCIATION'">
                    <select ng-model="cc.province" ng-options="c.city_id as c.city_name for c in cc.provinces">
                        <option value="">全部(省/直辖市)</option>
                    </select>
                </li> -->
                <li class="select_box" ng-if="cc.role=='ASSOCIATION'">
                    <select ng-model="cc.city" ng-options="c.city_id as c.city_name for c in cc.citys">
                        <option value="">全部(市/区)</option>
                    </select>
                </li>
                <li class="select_box" ng-if="cc.role=='ASSOCIATION'">
                    <select ng-model="cc.country" ng-options="c.city_id as c.city_name for c in cc.countrys">
                        <option value="">全部(县/区)</option>
                    </select>
                </li>
                <li class="select_box" ng-if="cc.role=='ASSOCIATION'">
                    <select ng-model="cc.town" ng-options="c.city_id as c.city_name for c in  cc.towns">
                        <option value="">全部(镇/乡)</option>
                    </select>
                </li>
                <!-- <li class="select_box" ng-if="cc.role=='ASSOCIATION'">
                    <select ng-model="cc.village" ng-options="c.city_id as c.city_name for c in  cc.villages">
                        <option value="">全部(村/社)</option>
                    </select>
                </li> -->
            	<li class="select_box" ng-if="cc.role=='AREA'">
            		<select ng-model="cc.area" ng-options="c.city_id as c.city_name for c in cc.areas">
            			<option value="">全部(市/县)</option>
            		</select>
            	</li>
                <li class="select_box" ng-if="cc.role=='AREA'">
                    <select ng-model="cc.village" ng-options="c.city_id as c.city_name for c in cc.villages">
                        <option value="">全部(镇/乡)</option>
                    </select>
                </li>
            	<li>
            		<div search-input ng-model="kw" placeholder="厨师姓名/电话" width="140"></div>
            	</li>
                <li>
                    <button class="btn btn-primary" data-ng-click="search($event)">查询</button>
                </li>
                <li ng-if="cc.role=='AREA'">
                	<a class="btn btn-default" href="#/app/cooks/add">添加</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="container-fluid bg-white">
        <table ng-table="cooksTable" class="table table-hover" template-pagination="templates/custom-pager.html">
            <thead>
                <th>厨师姓名</th>
                <th>厨师电话</th>
                <th>身份证</th>
                <th>厨师证号</th>
                <th>厨师等级</th>
                <th>证件有效期</th>
                <th>所在地</th>
                <th>接宴次数</th>
                <th>操作</th>
                <th ng-if="cc.role=='AREA'">状态</th>
            </thead>
        	<tbody ng-repeat="cook in $data">
        		<tr>
        			<td data-ng-bind="cook.co_username"></td>
        			<td data-ng-bind="cook.co_phone"></td>
        			<td data-ng-bind="cook.co_idcard"></td>
        			<td data-ng-bind="cook.co_num"></td>
        			<td data-ng-bind="cook.co_rank | rankFilter"></td>
        			<td data-ng-bind="cook.co_validity_period"></td>
        			<td data-ng-bind="cook.addr_info"></td>
        			<td data-ng-bind="cook.reports_count"></td>
        			<td>
        				<a href="#/app/cooks/detail?co_id={{cook.co_id}}">查看</a> 
                    	<span class="seperater" ng-if="cc.role=='AREA'">|</span>
                    	<a href="#/app/cooks/edit?co_id={{cook.co_id}}" ng-if="cc.role=='AREA'">编辑</a>
                    	<span class="seperater" ng-if="cc.role=='AREA'">|</span>
                    	<a href="javascript:;" ng-click="delCook(cook.co_id)" class="text-danger _delete" ng-if="cc.role=='AREA'">删除</a> 
        			</td>
        			<td ng-if="cc.role=='AREA'">
        				<div class="radio clip-radio radio-success radio-inline" style="margin-top: 0!important; margin-bottom: 0 !important;">
                            <input type="radio" id="cook_{{cook.co_id}}_active" name="cook_{{cook.co_id}}_status" value="Y" checked="checked" data-ng-model="cook.co_active_status" ng-click="changeStatus($event,cook, 'Y')">
                            <label for="cook_{{cook.co_id}}_active">
                                激活
                            </label>
                            <input type="radio" id="cook_{{cook.co_id}}_inactive" name="cook_{{cook.co_id}}_status" value="N" data-ng-model="cook.co_active_status" ng-click="changeStatus($event,cook, 'N')">
	                        <label for="cook_{{cook.co_id}}_inactive">
	                            冻结
	                        </label>
                        </div>
        			</td>
        		</tr>
        	</tbody>
        	<tfoot ng-if="$data.length ==0 && loaded">
        		<tr>
        			<td colspan="{{cc.role=='AREA'?9:10}}" style="text-align: center;">没有符合条件的厨师</td>
        		</tr>
        	</tfoot>
        </table>
        <div data-ng-show="!loaded"><loading></loading></div>
    </div>

</div>